using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableVegetablesPrice
	{
		public const string Table = "VegetablesPrice";
		public const string VegetablesPriceID = "VegetablesPriceID";
		public const string BusinessVegetablesPriceID = "BusinessVegetablesPriceID";
		public const string VegetablesID = "VegetablesID";
		public const string NowOriginalPrice = "NowOriginalPrice";
		public const string NowSalesGuidePrice = "NowSalesGuidePrice";
		public const string SetDate = "SetDate";
		public const string HomeProductTypeID = "HomeProductTypeID";
	}
	
	[Serializable]
	public class BaseVegetablesPrice
		: IDbSessionEntity, IJsonClass
	{
		int m_VegetablesPriceID;
		/// <summary>
        /// 
        /// </summary>
        public int VegetablesPriceID
        {
            get { return m_VegetablesPriceID; }
            set { m_VegetablesPriceID = value; }
        }
		
		int? m_BusinessVegetablesPriceID;
		/// <summary>
        /// 
        /// </summary>
        public int? BusinessVegetablesPriceID
        {
            get { return m_BusinessVegetablesPriceID; }
            set { m_BusinessVegetablesPriceID = value; }
        }
		
		int? m_VegetablesID;
		/// <summary>
        /// 
        /// </summary>
        public int? VegetablesID
        {
            get { return m_VegetablesID; }
            set { m_VegetablesID = value; }
        }
		
		double m_NowOriginalPrice;
		/// <summary>
        /// 
        /// </summary>
        public double NowOriginalPrice
        {
            get { return m_NowOriginalPrice; }
            set { m_NowOriginalPrice = value; }
        }
		
		double m_NowSalesGuidePrice;
		/// <summary>
        /// 
        /// </summary>
        public double NowSalesGuidePrice
        {
            get { return m_NowSalesGuidePrice; }
            set { m_NowSalesGuidePrice = value; }
        }
		
		DateTime m_SetDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime SetDate
        {
            get { return m_SetDate; }
            set { m_SetDate = value; }
        }
		
		int m_HomeProductTypeID;
		/// <summary>
        /// 
        /// </summary>
        public int HomeProductTypeID
        {
            get { return m_HomeProductTypeID; }
            set { m_HomeProductTypeID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_VegetablesPriceID = reader[TableVegetablesPrice.VegetablesPriceID];
            m_BusinessVegetablesPriceID = reader[TableVegetablesPrice.BusinessVegetablesPriceID];
            m_VegetablesID = reader[TableVegetablesPrice.VegetablesID];
            m_NowOriginalPrice = reader[TableVegetablesPrice.NowOriginalPrice];
            m_NowSalesGuidePrice = reader[TableVegetablesPrice.NowSalesGuidePrice];
            m_SetDate = reader[TableVegetablesPrice.SetDate];
            m_HomeProductTypeID = reader[TableVegetablesPrice.HomeProductTypeID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableVegetablesPrice.VegetablesPriceID, PrimaryKeyType.Identity, VegetablesPriceID);
			writer[TableVegetablesPrice.BusinessVegetablesPriceID] = BusinessVegetablesPriceID;
			writer[TableVegetablesPrice.VegetablesID] = VegetablesID;
			writer[TableVegetablesPrice.NowOriginalPrice] = NowOriginalPrice;
			writer[TableVegetablesPrice.NowSalesGuidePrice] = NowSalesGuidePrice;
			writer[TableVegetablesPrice.SetDate] = SetDate;
			writer[TableVegetablesPrice.HomeProductTypeID] = HomeProductTypeID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_VegetablesPriceID = idd;
        }
		
		public string TableName
        {
            get { return TableVegetablesPrice.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_VegetablesPriceID = hashToRead["VegetablesPriceID"];
			 
             m_BusinessVegetablesPriceID = hashToRead["BusinessVegetablesPriceID"];
			 
             m_VegetablesID = hashToRead["VegetablesID"];
			 
             m_NowOriginalPrice = hashToRead["NowOriginalPrice"];
			 
             m_NowSalesGuidePrice = hashToRead["NowSalesGuidePrice"];
			 
             m_SetDate = hashToRead["SetDate"];
			 
             m_HomeProductTypeID = hashToRead["HomeProductTypeID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["VegetablesPriceID"] = VegetablesPriceID;
			 
            hashToFill["BusinessVegetablesPriceID"] = BusinessVegetablesPriceID;
			 
            hashToFill["VegetablesID"] = VegetablesID;
			 
            hashToFill["NowOriginalPrice"] = NowOriginalPrice;
			 
            hashToFill["NowSalesGuidePrice"] = NowSalesGuidePrice;
			 
            hashToFill["SetDate"] = SetDate;
			 
            hashToFill["HomeProductTypeID"] = HomeProductTypeID;
			 
        }

        #endregion
		
	}
}
